﻿/**
 * 用户操作
 */
 Ext.regController(App.controllers.USER_MANAGER,{
 	rootName:App.views.USER_MANAGER,
 	checkLogin:function(){
 		alert('checking...');
 		//alert('用户已登录');
 		//Ext.redirect('home');
 		Ext.redirect('user/add');
 	},
 	userList:function(options){
 		Ext.redirect('view/' + this.rootName + ',userList', false);
 	},

 	addUser:function(option){
		var type = option.type; 
		if (type) {
			switch (type) {
				case 'tencent' :
					Ext.Msg.alert('愤怒的作者','等腾讯修正API吧，不开放腾讯的先。')
					//Ext.redirect('user/oauth/sign/' + type, false);
					break;
				case 'sina' :
					Ext.redirect('user/oauth/login/' + type, false);
					break;
				case 'netease' :
					Microblogging.unrealizedMsg();
					break;
				case 'sohu' :
					Microblogging.unrealizedMsg();
					break;
				default :
					break;
			}
		}
 	},
 	delUser:function(options){
 		alert(options.userIds);
 	},
 	setStatus:function(options){
 		var userIds = options.userIds.split(',');
 		if(userIds.length > 0){
 			alert('userIds:' + userIds + ',status:' + options.status);
 		}
 	},
 	editUser:function(){
 		
 	},
 	setting:function(){
 		
 	},
 	show:function(o){
		Ext.redirect('view/' + this.rootName, false);
 	}
 });